/*
 *@description:Home页面中使用的家政项目宫格组件
 *@Author:@rennan
 *@Date:2023-12-27 08:54:57
 *@version: V1.0.0
*/
<template>
  <div class="product" @click="handleClick">
    <div class="photo">
      <img :src="imgUrl" alt="">
    </div>
    <div class="name">{{ imgText }}</div>
  </div>
</template>
<script>
export default {
  props: ['imgUrl', 'imgText', 'productItem'],
  data() {
    return {
      product:this.productItem,
      show: false
    }
  },
  methods: {
    handleClick() {
      this.show = true
      this.$emit('get-show',this.show,this.product.id)
    }
  },
}
</script>
<style scoped>
.product {
  box-sizing: border-box;
  padding: 20px;
  width: calc(50% - 30px);
  height: 160px;
  box-shadow: 0 0 5px 0 #eadaff;
  border-radius: 5px;
  text-align: center;
  margin: 15px;
}

.product .photo {
  width: 100%;
  height: 60%;
  background-color: #eadaff;
  margin-bottom: 15px;
}

.product .photo img {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

.product .name {
  font-weight: 500;
  font-size: 20px;
  color: #333;
}

</style>